package com.dailyblue.java.spring.ioc.demo6;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class DemoB {
    // 标注这个方式初始化方法
    @PostConstruct
    public void init(){
        System.out.println("初始化方法，会在DemoB对象产生后调用");
    }
    @Deprecated
    public void destroy(){
        System.out.println("销毁方法，会在DemoB对象销毁前调用");
    }
}
